package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import java.util.*;
import bridge.*;

public class leagueTable1stRound_jsp extends HttpJspBase {


  private static java.util.Vector _jspx_includes;

  public java.util.List getIncludes() {
    return _jspx_includes;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    javax.servlet.jsp.PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=utf-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("﻿");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n\r\n\r\n");
 
 TableGenerator generator = new TableGenerator();
 generator.openFiles(generator.RESULTS_FILE_NAME);
 generator.getTeamResults();		
 generator.generateTable();
 generator.printTable();	  
 generator.closeFiles();

      out.write("\r\n\r\n");
      out.write("<HTML> \r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
      out.write("</head>\r\n");
      out.write("<BODY background=\"images/kolorki.JPG\">");
      out.write("<BR>\r\n\r\n");
      out.write("<table border=\"0\" cellspacing=\"3\" cellpadding=\"2\" width=\"630\">\r\n   ");
      out.write("<tr align=\"center\">\r\n     ");
      out.write("<td align=\"center\">");
      out.write("<b> TERMINARZ ");
      out.write("</b>");
      out.write("</td>\r\n   ");
      out.write("<tr align=\"center\">\r\n\t ");
      out.write("<td align=\"center\">");
      out.write("<b> rozgrywek DMP - Liga Okręgowa Wrocław ");
      out.write("</b>");
      out.write("</td>\r\n   ");
      out.write("<tr align=\"center\">\r\n\t ");
      out.write("<td align=\"center\">");
      out.write("<b> 2010/2011 - runda I. ");
      out.write("</b>");
      out.write("</td>\r\n   ");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<BR>\r\n");
      out.write("<TABLE>\r\n  ");
      out.write("<TR>\r\n    ");
      out.write("<TD>\r\n\t\t");
      out.write("<TABLE cellSpacing=2 cellPadding=1 border=1\r\n\t\t  style=\"\r\n\t\t    font-family: Arial, sans-serif;\r\n\t\t    font-size: 13px;\r\n\t\t\tfont-weight: normal;\r\n\t\t\tcolor: #000000;\">\r\n\t\t  ");
      out.write("<TBODY>\r\n\t\t  ");
      out.write("<TR valign=bottom bgColor=#ffce00>\r\n\t\t    ");
      out.write("<TD align=\"middle\" height=\"20\" >");
      out.write("<B>M ");
      out.write("</B>");
      out.write("</TD>\r\n\t\t    ");
      out.write("<TD align=\"middle\"  >");
      out.write("<B>Drużyna ");
      out.write("</B>");
      out.write("</TD>\r\n\r\n\t\t  ");
 Iterator teams = generator.getTeams().iterator();
		    int counter = 1;
		    while(teams.hasNext()) {
		        Team team = (Team) teams.next();
		  
      out.write("\r\n\t\t    ");
      out.write("<TD align=\"center\"   style=\"font-size: 10px; \">");
      out.write("<B>");
      out.print(counter++);
      out.write(".");
      out.write("</B>");
      out.write("</TD>\r\n\t\t ");
}
      out.write("\r\n\t\t\t");
      out.write("<TD align=\"center\"  >");
      out.write("<B>Suma ");
      out.write("</B>");
      out.write("</TD>\t\t    \r\n\t\t\t");
      out.write("<TD align=\"center\"  > Średnia  ");
      out.write("</TD>\r\n\t\t    \r\n\t\t  ");
      out.write("</TR>\r\n\t\t  \r\n\t\t ");
 teams = generator.getTeams().iterator();
		    counter = 1;
		    while(teams.hasNext()) {
		        Team team = (Team) teams.next();
		  
      out.write("\r\n\t\t  \r\n\t\t ");
      out.write("<TR bgColor=\"");
      out.print(((counter%2 == 0)?"#FFF7D6":"#ffef9c"));
      out.write("\")>\r\n\t\t    ");
      out.write("<TD valign=top align=right width=\"20\">");
      out.print(counter++);
      out.write(". ");
      out.write("</TD>\r\n\t\t    ");
      out.write("<TD valign=top align=left width=\"150\">");
      out.print(team.getName());
      out.write(" ");
      out.write("</TD>\r\n\t\t    \r\n\t\t    ");
 for (int wynik = 0; wynik<12;wynik++) {
      out.write("\r\n\t\t    ");

		    int numerDruzyny = Integer.parseInt((((Team)(generator.getTeams().get(wynik))).getNumber()).trim())-1;
		    if (wynik+2==counter) {
      out.write("\r\n\t\t    \t\t    \t");
      out.write("<TD valign=top align=middle width=\"20\">X");
      out.write("</TD>     \r\n\t\t    ");
} else {
		    	
      out.write("\r\n\t\t\t    ");
      out.write("<TD valign=top align=middle width=\"20\">");
      out.print(team.getResult(numerDruzyny));
      out.write("</TD>        \r\n\t\t\t");
}}
      out.write("\r\n\t\t\t\t\t      \r\n\t\t    ");
      out.write("<TD valign=top align=middle width=\"45\" >");
      out.write("<b>");
      out.print(team.getSumOfResults());
      out.write("</b>");
      out.write("</TD>    \r\n\t\t\t");
      out.write("<TD valign=top align=middle width=\"45\" style=\"font-size: 10px; \">");
      out.print(team.getSrednia());
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>\r\n\t\t  ");
}
      out.write("\r\n\t\t\r\n\t\t  ");
      out.write("</TBODY>\r\n\t\t");
      out.write("</TABLE>\r\n\t  ");
      out.write("</TD>\r\n\t  ");
      out.write("<TD>\r\n\t    ");
      out.write("<TABLE width=300>\r\n\t\t  ");
      out.write("<TBODY>\r\n\t\t  ");
      out.write("<TR align=center>\r\n\t\t    ");
      out.write("<TD colspan='2'>");
      out.write("<B>\t\t  \r\n\t\t    \t");
      out.write("<a href=\"javascript:void()\" onClick=\"window.open('/2010-11Term_LOgrW_R1.pdf','Terminarz','');\"> Terminarz ");
      out.write("</a>  (ze strony DZBS)");
      out.write("</B>\r\n\t\t    ");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>  \r\n\t\t  ");
      out.write("<TR align=center>\r\n\t\t    ");
      out.write("<TD colspan='2'>");
      out.write("<B>\t\t  \r\n\t\t    &nbsp;\r\n\t\t    ");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>  \r\n\t\t  \r\n\t\t  ");
      out.write("<TR align=middle>\r\n\t\t    ");
      out.write("<TD align=right>");
      out.write("<B>Prześlij wyniki:");
      out.write("</B>");
      out.write("</TD>\r\n\t\t    ");
      out.write("<TD align=left >");
      out.write("<A href=\"mailto:bajo3000@wp.pl\">\r\n\t\t    \t");
      out.write("<IMG alt=\"Napisz do BAJO\" src=\"images/napisz.gif\" border=0>");
      out.write("</A> ");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>\r\n\t\t  ");
      out.write("<TR align=center>\r\n\t\t    ");
      out.write("<TD colspan='2'>");
      out.write("<B>");
      out.write("<a href=\"/main2004.html\">Wyniki sezon 2003/2004");
      out.write("</a>");
      out.write("</B>");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>  \r\n\t\t  ");
      out.write("<TR align=center>\r\n\t\t    ");
      out.write("<TD colspan='2'>");
      out.write("<B>");
      out.write("<a href=\"/main2005.html\">Wyniki sezon 2004/2005");
      out.write("</a>");
      out.write("</B>");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>  \r\n\t\t  ");
      out.write("<TR align=center>\r\n\t\t    ");
      out.write("<TD colspan='2'>");
      out.write("<B>");
      out.write("<a href=\"/main2006.html\">Wyniki sezon 2005/2006");
      out.write("</a>");
      out.write("</B>");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>  \r\n\t\t  ");
      out.write("<TR align=center>\r\n\t\t    ");
      out.write("<TD colspan='2'>");
      out.write("<B>");
      out.write("<a href=\"/main2007.html\">Wyniki sezon 2006/2007");
      out.write("</a>");
      out.write("</B>");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>  \r\n\t\t  ");
      out.write("<TR align=center>\r\n\t\t    ");
      out.write("<TD colspan='2'>");
      out.write("<B>");
      out.write("<a href=\"/main2009.html\">Wyniki sezon 2008/2009");
      out.write("</a>");
      out.write("</B>");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>  \r\n\t\t  ");
      out.write("<TR align=center>\r\n\t\t    ");
      out.write("<TD colspan='2'>");
      out.write("<B>");
      out.write("<a href=\"/main2010.html\">Wyniki sezon 2009/2010");
      out.write("</a>");
      out.write("</B>");
      out.write("</TD>\r\n\t\t  ");
      out.write("</TR>  \r\n\t\t  ");
      out.write("</TBODY>\r\n\t\t");
      out.write("</TABLE>\r\n\t  ");
      out.write("</TD>\r\n\t");
      out.write("</TR>\r\n");
      out.write("</TABLE>\r\n");
      out.write("<BR>\r\n\r\n");
      out.write("<U>");
      out.write("<a href=\"http://www.msc.com.pl/cezar/index.php?p=210\"> Drużyny i składy ");
      out.write("</a>");
      out.write("</U> ");
      out.write("<BR>\r\n\r\n");
      out.write("<OL>\r\n\t\r\n");
      out.write("<li>KS AZS P. VIII\r\n");
      out.write("<li>KS Borowianka Borowa\r\n");
      out.write("<li>KS AZS P. XII\r\n");
      out.write("<li>KS Zakrzów\r\n");
      out.write("<li>KBS Kolejarz I \r\n");
      out.write("<li>KS Gwardia I\r\n");
      out.write("<li>KS Gwardia II\r\n");
      out.write("<li>KS Gwardia III\r\n");
      out.write("<li>KS Gwardia VII K\r\n");
      out.write("<li>KS Gwardia VIII K\r\n");
      out.write("<li>KS Turbo II Promyk\r\n");
      out.write("<li>SBS Miles I Milicz\r\n");
      out.write("</OL>\r\n  \r\n");
      out.write("<a href=\"/Sklady_na_mecze_AZSXII_201011_01.xls\"> Składy na mecze ");
      out.write("</a>\r\n\r\n\r\n\r\n");
      out.write("</BODY>");
      out.write("</HTML>\r\n");
    } catch (Throwable t) {
      out = _jspx_out;
      if (out != null && out.getBufferSize() != 0)
        out.clearBuffer();
      if (pageContext != null) pageContext.handlePageException(t);
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
}
